package cn.sc.utils;

import cn.sc.exceptions.CacheException;

/**
 * @ClassName ParameterValidation
 * @Author 谢卓才
 * @Description 工具类，用来弥补其他工具类
 * @Date 2022/11/13 9:17
 */
public class ParameterValidation {

    public static void isNotNull(String parm,String message){
        if(parm == null || parm.isEmpty()){
            if (message == null || message.isEmpty()){
                throw new CacheException("参数为空");
            }
            throw new CacheException(message);
        }
    }

    public static boolean isNull(String... param){
        return (param == null && param.length == 0);
    }

    public static boolean isNull(byte[][] param){
        return (param == null && param.length == 0);
    }

    public static boolean isNull(byte[] param){
        return (param == null || param.length == 0);
    }
}
